#include "iostream"
#include "malloc.h"
using namespace std;
typedef struct link{
	int data;
	link *next;
}link;
void print(link head){
	link *p=&head;
	while(p->next!=NULL){
		cout<<p->data<<" ";
		p=p->next;
	}
	cout<<p->data;
}
void converse(int a[],link &head){
	link *p,*p2;
	int i;
	for(i=1;i<=a[0];i++){
		p=&head;
		while(p->next!=NULL){
			if(p->next->data<a[i]){
				p=p->next;
			}
			else if(p->next->data==a[i])
				break;
			else{
				p2=(link *)malloc(sizeof(link));
				p2->next=p->next;
				p2->data=a[i];
				p->next=p2;
				break;
			}
		}
		if(p->next==NULL){
			p2=(link *)malloc(sizeof(link));
				p2->next=NULL;
				p2->data=a[i];
				p->next=p2;
		}
	}
}
int main(){
	int i,n,a[1000],t1;
	link head[20];
	link *p;
	for(i=0;i<20;i++){
		head[i].data=0;
		head[i].next=NULL;
	}
	for(i=1;i<20;i++){
		a[0]=0;
		for(t1=0;t1<i;t1++){
			p=&head[i-t1-1];
			while(p!=NULL){
				a[++a[0]]=(i-t1)*(t1+1)+p->data;
				p=p->next;
			}
		}
		converse(a,head[i]);
	}
	while(scanf("%d",&n)!=EOF){
		print(head[n-1]);
		cout<<"\n";
	}
}
